<%@ Page Title="" MasterPageFile="~/BackOffice.master" Language="C#" AutoEventWireup="true"
    CodeBehind="CadastroTicketfin.aspx.cs" Inherits="MakeIT.SGI.ERP.Apresentacao.CadastroTicketfin" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="cHeadHttpEquiv" ContentPlaceHolderID="headHttpEquiv" runat="server">
</asp:Content>
<asp:Content ID="cHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="cCadastro" ContentPlaceHolderID="cphTituloCadastro" runat="server">
    Cadastro de Ticket&nbsp;Financeiro (ticketfin)
</asp:Content>
<asp:Content ID="cMain" ContentPlaceHolderID="cphMain" runat="server">
    <asp:UpdatePanel ID="upnTicketfin" runat="server">
        <ContentTemplate>
            <asp:TabContainer ID="tabTicketfin" runat="server" ActiveTabIndex="0">
                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 100%; background-color: #eeeeff; min-width: 400px; min-height: 300px;">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="middle" style="width: 24px;">
                                        <asp:ImageButton ID="ibPesquisa" runat="server" OnClick="btnPesquisa_Click" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/search.png"
                                            ToolTip="Executa a pesquisa aplicando os filtros" />
                                    </td>
                                    <td valign="middle" align="left">
                                        Filtros:
                                    </td>
                                    <td>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                C&oacute;digo:</div>
                                            <asp:TextBox ID="txtIdTicketFin" MaxLength="11" Width="76" onkeypress="strictNum();"
                                                onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true"
                                                runat="server"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="meetxtIdTicketFin" runat="server" Mask="99999999999"
                                                TargetControlID="txtIdTicketFin" PromptCharacter="" />
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Filial:</div>
                                            <asp:DropDownList ID="ddlIdFilial" ForeColor="DarkBlue" Font-Bold="true"
                                                runat="server" DataTextField="Filial" DataValueField="PKString">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Origem&nbsp;do&nbsp;Ticket:</div>
                                            <asp:DropDownList ID="ddlOrigem" ForeColor="DarkBlue" Font-Bold="true"
                                                runat="server" >
                                            </asp:DropDownList>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Finalidade:</div>
                                            <asp:TextBox ID="txtFinalidade" MaxLength="45" Width="100" ForeColor="DarkBlue" Font-Bold="true"
                                                runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                                        <div class="FormLabel" align="center">
                                                            Data&nbsp;do&nbsp;Ticket:</div>
                                                        <div class="FormDiv">
                                                            <div class="FormLabel">
                                                                De:</div>
                                                            <asp:TextBox ID="txtDtTicketFinDe" MaxLength="10" Width="80px" onkeypress="MascaraData();"
                                                                onblur="validaData();" ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                                            <asp:ImageButton ID="imgtxtDtTicketFinDe" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                                            <asp:CalendarExtender ID="cetxtDtTicketFinDe" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                                Enabled="True" TargetControlID="txtDtTicketFinDe" PopupButtonID="imgtxtDtTicketFinDe"
                                                                Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                            </asp:CalendarExtender>
                                                        </div>
                                                        <div class="FormDiv">
                                                            <div class="FormLabel">
                                                                At&eacute;:</div>
                                                            <asp:TextBox ID="txtDtTicketFinAte" MaxLength="10" Width="80px" onkeypress="MascaraData();"
                                                                onblur="validaData();" ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                                            <asp:ImageButton ID="imgtxtDtTicketFinAte" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                                            <asp:CalendarExtender ID="cetxtDtTicketFinAte" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                                Enabled="True" TargetControlID="txtDtTicketFinAte" PopupButtonID="imgtxtDtTicketFinAte"
                                                                Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                            </asp:CalendarExtender>
                                                        </div>
                                                    </div>
                                                    <div class="FormDiv">
                                                        <div class="FormLabel" align="center">
                                                            Data&nbsp;do&nbsp;Acolhimento:</div>
                                                        <div class="FormDiv">
                                                            <div class="FormLabel">
                                                                De:</div>
                                                            <asp:TextBox ID="txtDtAcolhimentoDe" MaxLength="10" Width="80px" onkeypress="MascaraData();"
                                                                onblur="validaData();" ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                                            <asp:ImageButton ID="imgtxtDtAcolhimentoDe" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                                            <asp:CalendarExtender ID="cetxtDtAcolhimentoDe" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                                Enabled="True" TargetControlID="txtDtAcolhimentoDe" PopupButtonID="imgtxtDtAcolhimentoDe"
                                                                Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                            </asp:CalendarExtender>
                                                        </div>
                                                        <div class="FormDiv">
                                                            <div class="FormLabel">
                                                                At&eacute;:</div>
                                                            <asp:TextBox ID="txtDtAcolhimentoAte" MaxLength="10" Width="80px" onkeypress="MascaraData();"
                                                                onblur="validaData();" ForeColor="DarkBlue" Font-Bold="True" runat="server"></asp:TextBox>
                                                            <asp:ImageButton ID="imgtxtDtAcolhimentoAte" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                                            <asp:CalendarExtender ID="cetxtDtAcolhimentoAte" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                                Enabled="True" TargetControlID="txtDtAcolhimentoAte" PopupButtonID="imgtxtDtAcolhimentoAte"
                                                                Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                            </asp:CalendarExtender>
                                                        </div>
                                                    </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">
                                                Situa&ccedil;&atilde;o:</div>
                                            <asp:DropDownList ID="ddlSituacao" ForeColor="DarkBlue" Font-Bold="true" runat="server">
                                                <asp:ListItem Text="Todos" Value=" "></asp:ListItem>
                                                <asp:ListItem Text="Acolhido" Value="A"></asp:ListItem>
                                                <asp:ListItem Text="Transa&ccedil;&atilde;o" Value="T"></asp:ListItem>
                                            </asp:DropDownList>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <hr />
                            <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!"
                                CellPadding="1" ForeColor="#333333" GridLines="Both" RowStyle-ForeColor="#333333"
                                RowStyle-BackColor="#F7F6F3" AllowPaging="true" PageSize="50" OnPageIndexChanging="grvResultado_PageIndexChanging"
                                OnRowDataBound="grvResultado_RowDataBound">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                ImageUrl="~/App_Themes/Padrao/imagens/backoffice/editar.gif" CommandArgument='<%#Eval("PKString") %>'
                                                ToolTip="Abrir formulário completo" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="idTicketFin" HeaderText="C&oacute;digo" DataFormatString="{0:N0}" />
                                    <asp:BoundField DataField="origem" HeaderText="Origem&nbsp;do&nbsp;Ticket" />
                                    <asp:BoundField DataField="finalidade" HeaderText="Finalidade" />
                                    <asp:TemplateField HeaderText="Situa&ccedil;&atilde;o">
                                        <ItemTemplate>
                                            <asp:Label ID="lblsituacao" runat="server" Text="Situacao"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="valor" HeaderText="Valor" DataFormatString="{0:C}" />
                                    <asp:BoundField DataField="dtTicketFin" HeaderText="Data&nbsp;e&nbsp;Hora&nbsp;do&nbsp;Ticket"
                                        DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" />
                                    <asp:BoundField DataField="dtAcolhimento" HeaderText="Data&nbsp;e&nbsp;Hora&nbsp;do&nbsp;Acolhimento"
                                        DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" />
                                </Columns>
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#999999" />
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            </asp:GridView>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabCadastro" runat="server" HeaderText="Cadastro">
                    <ContentTemplate>
                        <asp:Panel ID="panelCad" runat="server" BackColor="#eeeeee">
                            <div style="width: 100%; min-width: 400px; min-height: 300px;">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    C&oacute;digo:</div>
                                                <asp:TextBox ID="txtCadIdTicketFin" MaxLength="11" Width="76" onkeypress="strictNum();"
                                                    onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true"
                                                    runat="server" ReadOnly="true"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Data&nbsp;e&nbsp;Hora&nbsp;do&nbsp;Ticket:</div>
                                                <asp:TextBox ID="txtCadDtTicketFin" onkeypress="MascaraData();"
                                                    onblur="validaData();" ForeColor="DarkBlue" Font-Bold="true" runat="server" ReadOnly="true"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Movimento&nbsp;de&nbsp;Origem:</div>
                                                <asp:TextBox runat="server" ID="txtCadMvtoOrigem" Text=""
                                                     ReadOnly="true" ForeColor="DarkBlue" Font-Bold="true" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Data&nbsp;e&nbsp;Hora&nbsp;do&nbsp;Acolhimento:</div>
                                                <asp:TextBox ID="txtCadDtAcolhimento" onkeypress="MascaraData();"
                                                    ForeColor="DarkBlue" Font-Bold="true" runat="server" ReadOnly="true"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                   Movimento&nbsp;dO&nbsp;Acolhimento:</div>
                                                <asp:TextBox runat="server" ID="txtCadMvtoAcolhimento" Text="" ReadOnly="true"
                                                    ForeColor="DarkBlue" Font-Bold="true"  />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Valor:</div>
                                                <asp:TextBox ID="txtCadValor" MaxLength="17" onkeypress="mascaraMoeda();"
                                                     ForeColor="DarkBlue" Font-Bold="true" ReadOnly="true" runat="server"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Finalidade&nbsp;do&nbsp;do&nbsp;Ticket:</div>
                                                <asp:TextBox ID="txtCadFinalidade" MaxLength="45" Width="280" ForeColor="DarkBlue"
                                                    Font-Bold="true" runat="server" ReadOnly="true"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">
                                                    Situa&ccedil;&atilde;o:</div>
                                                <asp:DropDownList ID="ddlCadSituacao" ForeColor="DarkBlue" Font-Bold="true" runat="server" Enabled="false">
                                                    <asp:ListItem Text="Todos" Value=" "></asp:ListItem>
                                                    <asp:ListItem Text="Acolhido" Value="A"></asp:ListItem>
                                                    <asp:ListItem Text="Transa&ccedil;&atilde;o" Value="T"></asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <hr />
                                            <table border="0" cellpadding="0" cellspacing="3">
                                                <tr>
                                                    <td class="FormLabel">
                                                        Data Cadastro:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Cadastrado por:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Data Edi&ccedil;&atilde;o:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Editado por:
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataCadastro" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltCadastradoPor" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataEdicao" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEditadoPor" runat="server"></asp:Literal>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
